﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="AdminManage.aspx.cs" Inherits="Admin_AdminManage" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        名称：<asp:TextBox runat="server" ID="txtName" MaxLength="16"></asp:TextBox><br />
        密码：<asp:TextBox runat="server" ID="txtPwd" MaxLength="24"></asp:TextBox><br />
        <asp:Button runat="server" ID="btnCreate" Text="添加" OnClick="btnCreate_Click" />
        <asp:Button runat="server" ID="btnUpdate" Text="更新" OnClick="btnUpdate_Click" Visible="False" />
        <asp:Repeater runat="server" ID="rptManagerList" OnItemCommand="rptManagerList_ItemCommand">
            <HeaderTemplate>
                <table>
                    <tr>
                        <td>
                            ID
                        </td>
                        <td>
                            NAME
                        </td>
                        <td>
                            操作
                        </td>
                    </tr>
            </HeaderTemplate>
            <ItemTemplate>
                <tr>
                    <td>
                        <%#Eval("ID") %>
                    </td>
                    <td>
                        <%#Eval("AdminName") %>
                    </td>
                    <td>
                        <input type="button" id="btnEdit" value="编辑" onclick="return toUpdate(<%#Eval("ID") %>);" />
                        <asp:Button runat="server" ID="btnDel" Text="删除" CommandName="del" CommandArgument='<%#Eval("ID") %>' OnClientClick="return confirm('确认要删除吗？');" />
                    </td>
                </tr>
            </ItemTemplate>
            <FooterTemplate>
                </table>
            </FooterTemplate>
        </asp:Repeater>
    </div>
    </form>
</body>
</html>

<script type="text/javascript">
    function toUpdate(id) {
        location.href = "AdminManage.aspx?ID=" + id;
    }
</script>

